package com.miui.systemui.tools


import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage

@State(name = "Figma2xmlSettings", storages = [Storage("figma2xmlSettings.xml")])
class Figma2xmlSettings : PersistentStateComponent<Figma2xmlSettings> {
    var mToken = ""

    override fun getState(): Figma2xmlSettings? {
        return this
    }

    override fun loadState(state: Figma2xmlSettings) {
        println("AutoPushApkSettings loadState：${state.mToken}")
        mToken = state.mToken
    }

    fun setToken(token: String):Figma2xmlSettings {
        this.mToken = token
        return this
    }

    companion object{
        fun getSettingsInstance(): Figma2xmlSettings {
            return ServiceManager.getService(Figma2xmlSettings::class.java)
        }
    }
}